<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.SQLException"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<%@page import="org.apache.log4j.Logger"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
	Connection conn = null;
	PreparedStatement pStat = null;
	ResultSet rs = null;
	Logger log = Logger.getLogger("demoConnection");
	try {
		String query = "select * from city1";
		conn = icst.cyber.hrm.communicationDB.Connection
				.getConnection();
		pStat = conn.prepareStatement(query);
		rs = pStat.executeQuery();

		while (rs.next()) {
			System.out.println(rs.getString("name"));
		}
	} catch (Exception ex) {
		log.error("demo query database", ex);
	} finally {
		try {
			if (rs != null)
				rs.close();
			if (pStat != null)
				pStat.close();
			if (conn != null)
				conn.close();
		} catch (SQLException e) {
			log.error("SQLException", e);
		}
	}
%>
bbbbbbb
</body>
</html>